package com.byzk.p2p.admin.money.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.byzk.p2p.admin.borrow.vo.BorrowRepayExportVo;
import com.byzk.p2p.admin.borrow.vo.BorrowTempVo;
import com.byzk.p2p.admin.money.dto.BorrowPayment;
import com.byzk.p2p.admin.money.dto.BorrowPaymentDetail;
import com.byzk.p2p.admin.money.vo.BorrowPaymentVo;
import com.byzk.p2p.admin.money.vo.SumMoneyVo;

/**
 * 借款人还款表	dao层
 * @author suker.zhou
 *
 */
public interface BorrowPaymentDao {

	public Integer deleteByPrimaryKey(Integer id);

	public Integer insert(BorrowPayment record);
	
	public Integer batchinsert(List<BorrowPayment> record);

	public Integer update(BorrowPayment record);

	public BorrowPaymentVo selectByPrimaryKey(Integer id);
	
	public BorrowPayment getById(Integer id);
	
	public Integer count(BorrowPaymentVo vo);
	
	public List<BorrowPaymentVo> list(BorrowPaymentVo vo);
	
	public List<BorrowPaymentVo> borrowUserRepaylist(BorrowPaymentVo vo);
	
	public List<BorrowPaymentVo> userPaymentList(BorrowPaymentVo vo);
	
	public List<BorrowPayment> listTodayPayment(String date);
	
	public List<BorrowPaymentVo> listBorrowPaymentByBorrowId(Integer borrowId);
	
	public BorrowPayment sumPayment(@Param("start")Date start,@Param("end")Date end);
	
	public BorrowPayment sumNotPayment(@Param("start")Date start,@Param("end")Date end);
	
	public BorrowPayment nextMonthPayment(String date);
	
	public SumMoneyVo sumBorrowPayment(BorrowPaymentVo vo);
	
	public List<BorrowPaymentVo> listByExportVo(BorrowRepayExportVo vo);
	
	public List<BorrowPaymentDetail> selectDetailsByBorrow(BorrowTempVo borrowTempVo);
	
	public BorrowPaymentVo getMinNotPaymentByBorrowId(Integer borrowId);
	
	public BorrowPaymentVo getMaxAlreadyPaymentByBorrowId(Integer borrowId);
	
	public BorrowPayment detail(@Param("borrowId")Integer borrowId, @Param("pid")Integer pid);

	public double selectDetailByBorrowIdAndTenderId(@Param("borrowId")Integer borrowId, @Param("tenderId")Integer tenderId);
	
	public double getDetailByBorrowIdAndTenderId(@Param("borrowId")Integer borrowId, @Param("tenderId")Integer tenderId);
}